package club.janna.springboot.study.bootstrap;

import club.janna.springboot.study.config.AppConfig;
import club.janna.springboot.study.service.AopUserService;
import club.janna.springboot.study.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringBootstrap {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        UserService userService = context.getBean(UserService.class);
        System.out.println(userService.getUsername());
        AopUserService aopUserService = context.getBean(AopUserService.class);
        System.out.println(aopUserService.getName());
    }
}
